package com.cherrish.demo.algorithm.sort;

/**
 * @author cherrish
 * @time 2019-02-22 14:18
 * @name SortBubble
 * @desc:
 */
public class SortBubble implements ISort {
    @Override
    public void sort(int[] arr, int len) {
        for(int i = 0; i < len - 1; i++){
            for(int j = 1; j < len - i; j++){
                if(arr[j] < arr[j - 1]){
                    ISort.swap(arr, j, j - 1);
                }
            }
        }
    }
}
